Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a formatter for assert_email_delivered_with/1 #482

Closed

Conversation

drapergeek
Copy link
Contributor

This should make it a bit easier to test emails without needing to use the specific format that bamboo uses.

Copy link
Contributor

@maymillerricci maymillerricci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 @drapergeek Thanks for this! I believe this also resolves #444. Think it's worth it to also add something to the documentation about this?

@@ -54,6 +54,7 @@ defmodule Bamboo.TestAdapterTest do
end

sent_email |> TestMailer.deliver_now()
assert_email_delivered_with(from: "foo@bar.com")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took me a second to understand this test, and I was wondering about the idea of having it be its own (named) test, but this does follow the existing pattern of including all of these within the same test about the helpers, so maybe making changes to it would be a separate issue? Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a huge fan of this style, but I wasn't going to fight against the current standard. I don't have a strong opinion in favor of changing it but I would say it's a separate issue.

@drapergeek
Copy link
Contributor Author

Hi @maymillerricci 👋!

Thanks for the review, will happily add some documentation! Yes, this will resolve #444

Copy link
Contributor

@maymillerricci maymillerricci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Just one tiny typo. 👍

@@ -182,6 +182,12 @@ defmodule Bamboo.Test do
unsent_email = Bamboo.Email.new_email(subject: "something else")
assert_email_delivered_with(subject: "something else") # Will fail

The function will use the Bamboo Formatter when checking email addresse.s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The function will use the Bamboo Formatter when checking email addresse.s
The function will use the Bamboo Formatter when checking email addresses.

@maymillerricci
Copy link
Contributor

Merged in 73592c5. Thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants